<template>
  <div class="newslist">
    <van-card
      v-for="item in newsList" :key="item.id"
      :desc="item.title"
      :title="item.zhaiyao"
      :thumb="item.img_url"
      :thumb-link="'#/home/newsinfo/'+item.id"
    >
    <template #price>
      {{item.add_time}}
    </template>
    <template #num>
      {{'点击'+item.click+'次'}}
    </template>
    </van-card>
  </div>
</template>
<script>
export default {
  data () {
    return {
      newsList: []
    }
  },
  created () {
    this.getNewsList()
  },
  methods: {
    async getNewsList () {
      const res = await this.$http.getNewsList()
      this.newsList = res.data.message
      // console.log(this.newsList)
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
